﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ITJZ.BitHelper.Local.API;

namespace ITJZ.BitHelper.Local.UI
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Local.API.User api = new User();
                APIModel.User user = api.Login(textBox1.Text, textBox2.Text);

                if (user != null)
                {
                    MessageBox.Show("登录成功");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("登录失败");

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {

        }
    }
}
